import CreateState from "../utils";

export const state = new CreateState({
    account: {
        firstName: '',
        lastName: '',
        age: '111111111111'
    },
    testList:[],
    test: 'hello world',

    get fullName() {
        const { firstName, lastName } = this.account;
        if (!firstName && !lastName) {
            return 'Please input your name!';
        }
        return `${firstName} ${lastName}`;
    },

    get testRule() {
        if (this.test.length > 10) {
            return {
                validateStatus: 'error',
                help: '不能超过10个字符',
            };
        }

        return {
            validateStatus: 'success',
            help: '成功',
        };
    }
});